package cn.sdormitory.service.impl;

import cn.sdormitory.service.AppSdHygieneItemRecordService;
import cn.sdormitory.smartdor.dao.SdHygieneItemRecordDao;
import cn.sdormitory.smartdor.entity.SdHygieneItemRecord;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author: lx
 * @date: 2023/10/20 15:18
 * @description:
 */
@Service
public class AppSdHygieneItemRecordServiceImpl extends ServiceImpl<SdHygieneItemRecordDao, SdHygieneItemRecord>
        implements AppSdHygieneItemRecordService {

    @Override
    public void createBatch(List<SdHygieneItemRecord> insertList) {
        this.saveBatch(insertList);
    }

    @Override
    public void deleteBatch(Long bdormitoryId, String checkDate) {
        LambdaQueryWrapper<SdHygieneItemRecord> wrapper = new LambdaQueryWrapper();
        wrapper.eq(SdHygieneItemRecord::getBdormitoryId,bdormitoryId)
                .eq(SdHygieneItemRecord::getCheckDate,checkDate);
        int delete = this.baseMapper.delete(wrapper);
//        System.err.println(delete);
    }
}
